<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <base href="<%=basePath%>">
    <link rel="stylesheet" href="static/component/pear/css/pear.css" />
    <link rel="stylesheet" href="static/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="static/css/public.css" media="all">
</head>
<body>

<input type="hidden" name="sapplicationCode" class="sapplicationCode" value="${sapplicationCode}">
<div class="layui-card">
    <div class="layui-card-body">
        <table id="shelfDetails" lay-filter="shelfDetails" class="layui-hide"></table>
    </div>
</div>



<script src="static/component/layui/layui.js"></script>
<script src="static/component/pear/pear.js"></script>
</body>

<script>
    //引入table
    layui.use(['table','form'],function() {
        var $ = layui.jquery;
        var from = layui.form;
        var table = layui.table;
        var form = layui.form;
        var sapplicationCode = $(".sapplicationCode").val();
        //执行表格的数据填充操作
        table.render({
            //指定渲染的表格
            elem: '#shelfDetails',
            //指定获取数据的路径
            url: 'shelfDetails/likeShelfDetails?sapplicationCode='+sapplicationCode,
            toolbar: '#toolbarDemo',
            //规定请求方式
            method: 'post',
            //开启分页
            page: true,
            check: true,
            //指定每页显示数
            limits: [1, 5, 10],
            even: true,
            cols: [[
                {field: 'shelfApplication', title: '所属申请单', align: 'center',templet: '#shelfApplication'},
                {field: 'stock', title: '库存商品', align: 'center',templet:'#stock'},
                {field: 'shelfCount', title: '数量', templet: "#repostory",align: 'center'},
                {field: 'storgageRack', title: '所在货架', align: 'center', templet: "#storgageRack"},
                {field: 'capacity', title: '所需容量', align: 'center', templet: "#purchaseState"}
            ]]
        })
    })
</script>


<script type="text/html" id="shelfApplication">
    {{d.shelfApplication.sapplicationCode}}
</script>
<script type="text/html" id="storgageRack">
    {{d.storgageRack.storgageRackName}}
</script>
<script type="text/html" id="stock">
    {{d.stock.goodsName}}
</script>
</html>